Why is a[2] == 2[a] the same?? I dont get a sintax error...could someone explain?
Why is a[2] == 2[a] the same?? I dont get a sintax error...could someone explain?
that is because a[2] is evaluated as *(a+2) where a is the starting address of the array elements..similarly, when you say 2[a], it is evaluated as *(2+a) which gives the same result.
Code:>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
GOT IT! thx dude!
Mmm, one of those weird and interesting tricks which serves no useful purpose in the real world.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I know!! But it comes on exams!
Do your own homework. Someone black flag this guy.
If you understand what you're doing, you're not learning anything.
> I know!! But it comes on exams!
Which usually tells me more about the examiner than the examiner would rather not have known about them...
Like whether you're being taught "how to program in C", or "A bunch of dumb tricks using void main, gets() and fflush(stdin)"
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.